using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("ScoreOdds")]
	[Serializable]
    public class ScoreOdd : DBO<ScoreOdd>
    {
		#region Fields
		
		private int? _IdScoreOdd;
		private int? _IdMatch;
		private int? _IdScore;
		private double? _Win;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public ScoreOdd()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdScoreOdd 
		/// </summary>
		/// <param name="IdScoreOdd">The IdScoreOdd</param>
		public ScoreOdd(int? IdScoreOdd )
		{
			this.IdScoreOdd = IdScoreOdd;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdScoreOdd">Sets int? value for IdScoreOdd</param>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="IdScore">Sets int? value for IdScore</param>
		/// <param name="Win">Sets double? value for Win</param>
		public ScoreOdd(int? idScoreOdd, int? idMatch, int? idScore, double? win)
		{
			this.IdScoreOdd = idScoreOdd;
			this.IdMatch = idMatch;
			this.IdScore = idScore;
			this.Win = win;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdScoreOdd
		/// </summary>
		[ColumnAttribute("IdScoreOdd", SqlDbType.Int , 4 , true, true, false)]
		public int? IdScoreOdd
		{
			set
			{
				this._IdScoreOdd = value;
			}
			get
			{
				return this._IdScoreOdd;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , false, false, true)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdScore
		/// </summary>
		[ColumnAttribute("IdScore", SqlDbType.Int , 4 , false, false, true)]
		public int? IdScore
		{
			set
			{
				this._IdScore = value;
			}
			get
			{
				return this._IdScore;
			}
		}
		
		/// <summary>
		/// Gets or sets double? value for Win
		/// </summary>
		[ColumnAttribute("Win", SqlDbType.Float , 8 , false, false, true)]
		public double? Win
		{
			set
			{
				this._Win = value;
			}
			get
			{
				return this._Win;
			}
		}
		
		
		/// <summary>
		/// Get a Match of current ScoreOdd object base on IdMatch
		/// </summary>
		public Match Match
		{
			get
			{
				if (this.IdMatch == null)
					return null;
	
				Match condition = new Match(this.IdMatch);
				return MatchController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Score of current ScoreOdd object base on IdScore
		/// </summary>
		public Score Score
		{
			get
			{
				if (this.IdScore == null)
					return null;
	
				Score condition = new Score(this.IdScore);
				return ScoreController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdScoreOdd]
            /// </summary>
            public string IdScoreOdd
            {
                get
                {
                    return "IdScoreOdd";
                }
            }
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [IdScore]
            /// </summary>
            public string IdScore
            {
                get
                {
                    return "IdScore";
                }
            }
            /// <summary>
            /// Get the name of column [Win]
            /// </summary>
            public string Win
            {
                get
                {
                    return "Win";
                }
            }
        }
        #endregion
    }
}
